/*
 * @Author: xiaosihan 
 * @Date: 2024-03-17 17:39:22 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2024-03-17 17:44:02
 */

import { autorun } from "mobx";
import { ReactNode, useEffect, useRef, useState } from "react";
import styles from "./projectName.module.less";
import homeStore from "../homeStore";

interface Iprops {
    children?: ReactNode
}

// 项目名称
export default function ProjectName(props: Iprops) {

    const dom = useRef<HTMLDivElement | null>(null);
    const [projectCode, setProjectCode] = useState(homeStore.projectCode);
    const [projecId, setProjecId] = useState(homeStore.projecId);
    const [projectName, setProjectName] = useState(homeStore.projectName);
    const [personResponsible, setPersonResponsible] = useState(homeStore.personResponsible);

    useEffect(() => {

    }, []);

    useEffect(() => autorun(() => {
        setProjectCode(homeStore.projectCode);
        setProjecId(homeStore.projecId);
        setProjectName(homeStore.projectName);
        setPersonResponsible(homeStore.personResponsible);
    }, { delay: 30 }), []);

    return (
        <div className={styles.projectName} >
            <div className={styles.border}>
                <div>项目名称 : {projectName}</div>
                <div>责&nbsp;任&nbsp;人 : {personResponsible}</div>
            </div>
        </div>
    );

}